const mongoose = require('mongoose')
// 链接数据库
mongoose.connect('mongodb://yiyang_mongodb:123456@8.130.15.216:27017/yiyang_mongodb?authSource=yiyang_mongodb')

const conn = mongoose.connection

conn.on('open', () => {
  console.log('连接成功' + 'http://localhost:3000')
})
conn.on('error', (err) => {
  console.log('连接失败' + err)
})
module.exports = mongoose